package com.eight.cloud.payment.core;



import com.eight.cloud.client.model.dto.PlatformOrderDto;
import com.eight.cloud.client.model.vo.OrderVo;
import com.eight.cloud.client.model.vo.RefundVo;
import com.eight.cloud.payment.common.enums.PayStrategyEnum;
import com.eight.cloud.payment.model.vo.SubPayOrderVo;
import com.eight.cloud.payment.model.vo.SubRefundOrderVo;

/**
 * 支付策略接口
 *
 * @InterfaceName: IPaymentService
 * @Author: TXC
 * @Date: 2024-10-21 16:43
 **/
public interface IPaymentStrategy {
    /**
     * 支付
     */
    String pay(PlatformOrderDto order);

    /**
     *  退款
     *
     * @param refundOrder 退款信息
     * @param notifyUrl 回调地址
     * @return 结果
     */
    String refund(SubRefundOrderVo refundOrder, String notifyUrl);

    /**
     * 退款订单查询
     *
     * @param subRefundOrder 退款订单
     * @return 详情
     */
    RefundVo queryByOutRefundNo(SubRefundOrderVo subRefundOrder);


    /**
     * 根据流水号查询订单
     *
     * @param subPayOrder 系统订单信息
     * @return 结果
     */
    OrderVo queryOrderById(SubPayOrderVo subPayOrder);

    /**
     * 根据商户订单号查询订单
     *
     * @param subPayOrder 系统订单信息
     * @return 结果
     */
    OrderVo queryOrderByOutTradeNo(SubPayOrderVo subPayOrder);

    /**
     * 关闭订单
     *
     * @param subPayOrder 系统订单信息
     * @return 结果
     */
    String closeOrder(SubPayOrderVo subPayOrder);

    /**
     * @return 支付策略枚举
     */
    PayStrategyEnum getPayStrategy();
}
